﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

using RemoteScriptingLibrary;
using RemoteScriptingLibrary.ScriptCommands;

namespace WindowsRemoteScripting.Action
{
    public class LoadFromURL : AbstractCommand
    {
        public override void Run(object sender, EventArgs e)
        {
            FormTypeCommand fd = new FormTypeCommand();
            if (fd.ShowDialog() != DialogResult.OK) return;

            string sInputText = fd.InputText;
            if (fd.chkbFromBrowser.Checked)
            {
                Script.Browse(sInputText);
             //   string sText = Script.m_Browser.Document.ToString();
            }
            else
            {
                Form1.m_Form.textBoxScript.Text = BrowserHelper.RetrieveData(sInputText);
            }
        }
    }
}
